package com.xiaoning.sun.spring.mvc.validator;

import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

import com.xiaoning.sun.spring.mvc.model.LoginForm;
import com.xiaoning.sun.spring.mvc.utils.FieldValidator;

@Component
public class LoginValidator implements Validator{

	@Override
	public boolean supports(Class<?> clazz) {
		return LoginForm.class.isAssignableFrom(clazz);
	}

	@Override
	public void validate(Object object, Errors errors) {
		FieldValidator.validator(object, errors);
	}


}
